package com.wxmit.base.enums;

import lombok.AllArgsConstructor;

import java.util.Objects;

/**
 * @Description BusinessStatus
 * @Author huangxiong
 * @Date 2022/7/12 11:30
 * @Version V1.0
 */
@AllArgsConstructor
public enum BusinessStatus {
    /**
     * 成功
     */
    SUCCESS("0"),

    /**
     * 失败
     */
    FAIL("1");

    public final String code;

    public static BusinessStatus getByCode(String status) {
        for (BusinessStatus value : values()) {
            if(Objects.equals(value.code,status)){
                return value;
            }
        }
        return null;
    }
}
